.\" Copyright (c) 1983 Regents of the University of California.
.\" All rights reserved.  The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.\"	@(#)stty.3c	6.1 (Berkeley) 5/15/85
.\"
.TH STTY 3C "May 15, 1985"
.UC 5
.SH NAME
stty, gtty \- set and get terminal state (defunct)
.SH SYNOPSIS
.nf
.B #include <sgtty.h>
.sp
.B stty(fd, buf)
.B int fd;
.B struct sgttyb *buf;
.sp
.B gtty(fd, buf)
.B int fd;
.B struct sgttyb *buf;
.fi
.SH DESCRIPTION
.ft B
This interface is obsoleted by ioctl(2).
.ft R
.PP
.I Stty
sets the state of the terminal associated with
.IR fd .
.I Gtty
retrieves the state of the terminal associated
with
.IR fd .
To set the state of a terminal the call must have
write permission.
.PP
The
.I stty
call is actually ``ioctl(fd, TIOCSETP, buf)'', while
the
.I gtty
call is ``ioctl(fd, TIOCGETP, buf)''.
See 
.IR ioctl (2)
and
.IR tty (4)
for an explanation.
.SH DIAGNOSTICS
If the call is successful 0 is returned, otherwise \-1 is
returned and the global variable
.I errno
contains the reason for the failure.
.SH SEE ALSO
ioctl(2),
tty(4)
